package com.example.lending.ViewModel;

import android.app.Application;

import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;

import com.example.lending.Model.Operation;
import com.example.lending.ViewModel.Repository.OperationRepository;

import java.util.List;

public class OperationViewModel extends AndroidViewModel {
    private OperationRepository operationRepository;

    public OperationViewModel(@NonNull Application application) {
        super(application);
        operationRepository = new OperationRepository(application);
    }
    public void insertOperations(Operation... operations){operationRepository.insertOperations(operations);}
    public void updataOperations(Operation... operations){operationRepository.updataOperations(operations);}
    public void deleteOperations(Operation... operations){operationRepository.deleteOperations(operations);}
    public void deleteAllOperations(Void... voids){operationRepository.deleteAllOperations();}
    public LiveData<List<Operation>>getAllOperationLive(){return operationRepository.getAllOperationLive();}

}
